+2004-02-16 Federico Mena Quintero <federico@ximian.com>
+
+ * gdk/tmpl/windows.sgml: Added an example of how to use
+ GDK_MODIFIER_MASK to test for modifier keys correctly.
+
Sun Feb 15 23:51:08 2004 Matthias Clasen <maclas@gmx.de>
* gtk/tmpl/gtkcomboboxentry.sgml:
@GDK_BUTTON5_MASK: the fifth mouse button.
@GDK_RELEASE_MASK: not used in GDK itself. GTK+ uses it to differentiate
between (keyval, modifiers) pairs from key press and release events.
-@GDK_MODIFIER_MASK:
+@GDK_MODIFIER_MASK: Mask that can be used to see if modifier keys are
+ pressed. See <xref linkend="keys-with-modifiers"/> for an example
+ of how to use this mask.
+
+ <example id="keys-with-modifiers">
+ <title>Testing for keys with modifiers</title>
+
+ <para>
+ The following code shows how you should use GDK_MODIFIER_MASK to
+ test for
+ <keycombo><keycap>Control</keycap><keycap>F10</keycap></keycombo>
+ being pressed.
+ </para>
+
+ <programlisting>
+static gboolean
+my_widget_key_press_handler (GtkWidget *widget, GdkEventKey *event)
+{
+ if (event->keysym == GDK_F10
+ && (event->state && GDK_MODIFIER_MASK) == GDK_CONTROL_MASK)
+ {
+ g_print ("Control-F10 was pressed\n");
+ return TRUE;
+ }
+
+ return FALSE;
+}
+ </programlisting>
+ </example>
<!-- ##### FUNCTION gdk_window_get_parent ##### -->
<para>
@Returns:
+<!--
+Local variables:
+mode: sgml
+sgml-parent-document: ("../gdk-docs.sgml" "book" "refsect2" "")
+End:
+-->